<?php
include('../conf/conf.php');
if(!$conn)
$conn = mysql_connect(DB_HOST.':3306', DB_USER, DB_PASS,true);
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}
 $version = mysql_get_server_info($conn);
 $db_charset = DB_CHARSET;
        /* 如果mysql 版本是 4.1+ 以上，需要对字符集进行初始化 */
        if ($version > '4.1')
        {
            if ($db_charset != 'latin1')
            {
                mysql_query("SET character_set_connection='$db_charset', character_set_results='$db_charset', character_set_client=binary", $conn);
            }
            if ($version > '5.0.1')
            {
                mysql_query("SET sql_mode=''", $conn);
            }
        }

mysql_select_db(DB_DATABASE);
if($_REQUEST['debug'])
{
echo $conn;
}
$conn = mysql_connect(DB_HOST.':3306', DB_USER, DB_PASS,true);
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}
 $version = mysql_get_server_info($conn);
 $db_charset = DB_CHARSET;
        /* 如果mysql 版本是 4.1+ 以上，需要对字符集进行初始化 */
        if ($version > '4.1')
        {
            if ($db_charset != 'latin1')
            {
                mysql_query("SET character_set_connection='$db_charset', character_set_results='$db_charset', character_set_client=binary", $conn);
            }
            if ($version > '5.0.1')
            {
                mysql_query("SET sql_mode=''", $conn);
            }
        }

mysql_select_db(DB_DATABASE);
if($_REQUEST['debug'])
{
echo $conn;
}
?>
